﻿using System;
using System.Collections.Generic;
using System.Text;
using System.Data.SqlClient;
using System.Data;
using Model;
using HT.DBUtility;

namespace HT.DAL
{
    public class Dal_Login
    {

        public DataTable GetyyydaH(string ygbh, string mm)
        {
            StringBuilder strSql = new StringBuilder();
            strSql.Append("select  top 1 DjLsh,DjBtZdh,DjFtZdh,DjStZdh,DjState,DjCount,ygbh,ymmc,dmbh,dmmc,Ygxb,Ygjg,xl,Ygbz,djyh,djsj,xgyh,xgsj,mm from yyydaH ");
            strSql.Append(" where ygbh='" + ygbh + "'  and mm='" + mm + "'");

            DataSet ds = SQLHelper.ExecuteDs(strSql.ToString());
            return ds.Tables[0];
        }
      
        /// <summary>
        /// 获取工号列表
        /// </summary>
        /// <returns></returns>
        public DataTable GetyyydaHbyGh(ref string error)
        {
            DataTable dt = null;
            try
            {
                string sql = "select ygbh,dmbh from yyydaH";
                dt = SQLHelper.ExecuteDt(sql);
                return dt;
            }
            catch (Exception ex)
            {
                error = ex.Message;
            }
            return dt;
        }
    }
}
